package com.jisf.driver.entity.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jisf.driver.entity.enumtype.DelFlagEnum;
import com.jisf.driver.entity.enumtype.NationalityMenu;
import com.jisf.driver.entity.enumtype.SexEnum;
import com.jisf.driver.entity.enumtype.StatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import java.util.Collection;
import java.util.Date;


/**
 * <p>
 * 用户表
 * </p>
 *
 * @author jisf
 * @since 2022-04-08
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("sys_user")
public class User implements UserDetails, Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 状态
     */
    private StatusEnum status;

    /**
     * 逻辑删除
     */
    private DelFlagEnum delFlag;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 电话
     */
    private String phoneNumber;

    /**
     * 姓名
     */
    private String name;

    /**
     * 性别
     */
    private SexEnum sex;

    /**
     * 国籍
     */
    private NationalityMenu nationality;

    /**
     * 住址
     */
    private String address;

    /**
     * 出生日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date dateOfBirth;

    /**
     * 身份证
     */
    private String identityCard;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }

}
